package com.front.web.mall;

import com.bootdo.common.utils.MD5Utils;
import com.bootdo.common.utils.R;
import com.bootdo.common.utils.StringUtils;
import com.bootdo.member.domain.ShequMember;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/f/shequMember")
public class ShequMemberFrontController extends MallSupperController{

    @RequestMapping("login")
    public R login(@RequestParam(value = "mobile", defaultValue = "")String mobile,
                   @RequestParam(value = "password", defaultValue = "")String password) {

        if (StringUtils.isEmpty(mobile) || StringUtils.isEmpty(password)) {
            return R.error();
        }

        ShequMember shequMember = new ShequMember();

        return R.ok().put("token", MD5Utils.encrypt(mobile, password)).put("i", shequMember);
    }

}
